﻿using System;
using System.ServiceProcess;

namespace Adventure.Service
{
    /// <summary>
    /// Main program of the windows service.
    /// </summary>
    public static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            if ((args.Length > 0) && args[0].Equals("startup", StringComparison.InvariantCultureIgnoreCase))
            {
                // Start the service on the console.
                var service = new AdventureService();
                service.Run();
            }
            else
            {
                // Start the windows service.
                ServiceBase.Run(new ServiceBase[]
                {
                    new AdventureService()
                });
            }
        }
    }
}
